<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title><?= $this->pageTitle;?></title>
	<link rel="alternate" type="application/rss+xml" href="/service/rss" title="Rss - просьбы"/>
	<link rel="alternate" type="application/rss+xml" href="/suggest/rss" title="Rss - предложения"/>

	<link rel="stylesheet" href="<?= Y::theme();?>/css/reset.css" type="text/css" media="screen"/>
	<link rel="stylesheet" href="<?= Y::theme();?>/css/style.css" type="text/css" media="screen"/>
	<link rel="stylesheet" href="<?= Y::theme();?>/css/css3-buttons.css" type="text/css" media="screen"/>
	<link rel="stylesheet" href="<?= Y::theme();?>/css/tiptip.css" type="text/css" media="screen"/>
	<!--[if gt IE 6]>
	<link rel="stylesheet" href="<?= Y::theme();?>/css/ie.css" type="text/css" media="screen"/>
	<![endif]-->
	<!--[if lte IE 6]>
	<link rel="stylesheet" href="http://universal-ie6-css.googlecode.com/files/ie6.1.1.css" media="screen, projection">
	<![endif]-->
	<link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic|Open+Sans:300,400,400italic,600' rel='stylesheet' type='text/css'>
	<script src="<?= Y::theme();?>/js/jquery.tiptip.js"></script>
	<script src="<?= Y::theme();?>/js/jquery.jcarousel.min.js"></script>

    <meta name="Description" content="<?= $this->description;?>">
    <meta name="Keywords" content="<?= $this->keyWord;?>">
    <link rel="shortcut icon" href="<?= Y::theme();?>/favicon.ico" type="image/x-icon" />
</head>
<body>
<div id="header">
	<div class="container">
		<a href="/" id="logo">
			HYHO
		</a>

		<?
			$this->widget('zii.widgets.CMenu', array(
				'id' => 'nav',
				'items' => array(
					array('label' => 'Главная', 'url' => array('site/index')),
					array('label' => 'Вход', 'url' => array('user/login'), 'visible' => Yii::app()->user->isGuest),
					array('label' => 'Регистрация', 'url' => array('user/registration'), 'visible' => Yii::app()->user->isGuest),
					array('label' => 'Просьбы', 'url' => array('service/list')),
					array('label' => 'Предложения', 'url' => array('suggest/list')),
					array(
						'label' => 'Личный кабинет',
						'url' => array('/user/' . Y::userId()),
						'visible' => !Yii::app()->user->isGuest,
					),
					array('label' => 'Люди', 'url' => array('/user/list')),
					array('label' => 'Выход', 'url' => array('user/logout'), 'visible' => !Yii::app()->user->isGuest),
				),
			));
		?>
	</div>
</div>
<div class="clear"></div>
<? if ($this->breadcrumbs) { ?>
<div id="breadcrumbs">
	<div class="container">
		<ul class="breadcrumbs buttons">
			<li class="home"><a href="/">Главная</a></li>
			<li>&rarr;</li>
			<li><?= $this->breadcrumbs['name']?></li>
			<?
				if (isset($this->breadcrumbs['name2'])) { ?>
					<li>&rarr;</li>
					<li><?= $this->breadcrumbs['name2']?></li>
				<?
				}
			    if (isset($this->breadcrumbs['btn'])) { ?>
					<li class="plus"><?= $this->breadcrumbs['btn']?></li>
				<? }
			?>
		</ul>
	</div>
</div>
<div class="clear"></div>
<? } elseif($this->statistic){?>
	<div id="breadcrumbs">
	<div class="container">
		<ul class="breadcrumbs" style="text-align: center;">
			<? $this->widget("Statistic"); ?>
		</ul>
	</div>
</div>
<? } ?>
<div id="content">
	<div class="container">
        <div id="main">
		<?php
			$this->widget('application.extensions.flash.Flash', array(
		        'keys' => array('success', 'error', 'success-block','errorMessage'),
	        ));
			echo $content;
		?>
	    </div>
        <div id="sidebar" style="margin-top: 10px;">
            <? if (!Yii::app()->user->isGuest && $this->getId() == "service") { ?>
                <div class="widget ">
				<a href="<?=Y::url("service/create");?>" class="button  green " style=" width: 295px;padding: 14px;">
					<span class="label" style="font-size: 16px; text-align: center; display: block;" >Создать просьбу</span>
				</a>
                </div>
            <? } if($this->getId() == "service"){ ?>
                <div class="widget">
                    <h5 class="widget-title">Прямой эфир</h5>
                    <? $this->widget("LiveComment", array("type" => $this->getId()));?>
                </div>
                <div class="widget">
                    <h5 class="widget-title">Топ помощников</h5>
                    <? $this->widget("Top10", array("type" => 2));?>
                </div>
			<? }?>
            <? if (!Yii::app()->user->isGuest && $this->getId() == "suggest") { ?>
                <div class="widget">
                    <a href="<?=Y::url("suggest/create");?>" class="button green" style=" width: 295px;padding: 14px;">
                        <span class="label" style="font-size: 16px; text-align: center; display: block;"> Создать предложение</span>
                    </a>
                </div>
            <? } if($this->getId() == "suggest"){ ?>
                <div class="widget">
                    <h5 class="widget-title">Прямой эфир</h5>
                    <? $this->widget("LiveComment", array("type" => $this->getId()));?>
                </div>
                <div class="widget">
                    <h5 class="widget-title">Топ просителей </h5>
                    <? $this->widget("Top10", array("type" => 3));?>
                </div>
			<? }?>
        </div>
	</div>
</div>
<div id="footer">
	<div class="container">
        <p>
            &copy; 2011, Сервис просьб и предложений. Все права <a href="http://www.pravo.by/webnpa/text.asp?RN=hk9900275">тут</a>.<br/>

        </p>
		<p class="align-left">

			<img src="<?= Y::theme();?>/img/feed.png"  style="vertical-align: middle;" />
			<a type="application/rss+xml" href="/service/rss"> RSS - просьбы</a> <br/>
			<img src="<?= Y::theme();?>/img/feed.png" style="vertical-align: middle;" />
			<a type="application/rss+xml" href="/suggest/rss"> RSS - предложения</a> <br/>


		</p>
        <p class="align-left" style="margin-left: 40px;">
            <img src="<?= Y::theme();?>/images/about.png" style="vertical-align: middle;" />
            <a href="/about">О проекте</a> <br/>
            <img src="<?= Y::theme();?>/images/donate.png" style="vertical-align: middle;" />
            <a href="/donate">Помогите проекту</a>
        </p>
		<div class="align-right">
			<?php $this->widget('WSocialButton', array('style'=>'standard'));?>
		</div>
	</div>
</div>
<script>
	$(document).ready(function() {
		$('.tiptip a.button, .tiptip button, .tiptip .tip').tipTip();
	});
</script>
</body>
</html>
